<!DOCTYPE html>
<html>
	<head>
		<title></title>
	</head>
	<body>
	<script>
		var a=parseInt(prompt("请输入循环求和的起始值："));
		var b=parseInt(prompt("请输入循环求和的中止值："));
		function sum(a,b){
			var d=0;
			for(var c=a;c<=b;c++)
			{
				d=d+c;
			}
			return d;
		}
		var result=sum(a,b);
		document.write("和:"+result);
	</script>
		
	</body>
</html>